﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAplicaciones1
{
    public class Gift : Agregado
    {
        private Item item;
        private String descripcion;
        private double rangoBase;
        private double rangoTope;



        public Item Item
        {
            get { return item; }
            set { item = value; }
        }

        public double RangoBase
        {
            get { return rangoBase; }
            set { rangoBase = value; }
        }


        public double RangoTope
        {
            get { return rangoTope; }
            set { rangoTope = value; }
        }

        public String Descripcion
        {
            get { return descripcion; }
            set { descripcion = value; }
        }

        public override Agregado Copia()
        {
            Gift giftCopia = new Gift();
            giftCopia.Precio = this.precio;
            if (this.Item == null)
            {
                giftCopia.Descripcion = this.descripcion;
            }else
                giftCopia.Item = this.Item;

            giftCopia.rangoBase = this.rangoBase;
            giftCopia.rangoTope = this.rangoTope;
            return giftCopia;
        }
        public override double calcularCosto()
        {
            return base.calcularCosto() + this.precio;
        }

        public void SetComponent(Componente componente)
        {
            this.componente = componente;
        }

        public Gift(double Precio_converted,string Descripcion, double Desde_converted, double Hasta_converted) 
        {
            this.OID = Guid.NewGuid().ToString();
            this.Precio=Precio_converted;
            this.item = null;
            this.Descripcion = Descripcion;
            this.RangoBase = Desde_converted;
            this.RangoTope = Hasta_converted;
        }

        public Gift(string Oid,double Precio_converted, string Descripcion, double Desde_converted, double Hasta_converted)
        {
            this.OID = Oid;
            this.Precio = Precio_converted;
            this.item = null;
            this.Descripcion = Descripcion;
            this.RangoBase = Desde_converted;
            this.RangoTope = Hasta_converted;
        }
        public Gift(double Precio_converted,Item item, double Desde_converted, double Hasta_converted)
        {
            this.OID = Guid.NewGuid().ToString();
            this.Precio = Precio_converted;
            this.Item = item;
            this.Descripcion = null;
            this.RangoBase = Desde_converted;
            this.RangoTope = Hasta_converted;
        }

        public Gift(string Oid, double Precio_converted, Item item, double Desde_converted, double Hasta_converted)
        {
            this.OID = Oid;
            this.Precio = Precio_converted;
            this.Item = item;
            this.Descripcion = null;
            this.RangoBase = Desde_converted;
            this.RangoTope = Hasta_converted;
        }

        public Gift() 
        {
        }
    }
}
